<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<link href="themes01/default/clientPublic.css" rel="stylesheet" type="text/css"/>
<link href="themes01/default/codeMgr.css" rel="stylesheet" type="text/css"/>
<link href="themes01/default/tabSwitch.css" rel="stylesheet" type="text/css"/>
<link rel="StyleSheet" href="themes01/default/dtree.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="themes01/default/pstyle.css">
<script type="text/javascript" src="javascripts01/dtree.js"></script>
<script type="text/javascript" src="javascripts01/jquery.js"></script>
<script type="text/javascript" src="javascripts01/common.js"></script>
<script language="javascript" type="text/javascript" src="DatePicker/WdatePicker.js"></script>
<title>Office 515158 2011 OA办公系统</title>
 
</head>
<body>
<div id="Holder">
<div id="MainPage">

 
 
<div id="Subnav">
 
<ul>
<?php
//定义标题
$nums=77;
global $db;
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."menu where fatherid='11' and menutype='0' ORDER BY menunum Asc");
	while ($row = $db->fetch_array($query)) {
?>
<li><a href="<?=$row[menuurl]?>"  <? if($nums==$row[menuid]){?> id="Subnavb"<? }?>><?=$row[menuname]?></a></li>
<?php
	}
?>


</ul>
</div>
<table width="100%" height="400" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color:#FDFDFD;">
  <tr>
    <td width="240" align="center" valign="top" style="padding-left:10px; padding-top:6px;">
	  <table width="230" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7%" align="center"><img src="themes01/default/images/green_arrow.gif" width="17" height="17" /></td>
          
          <td width="64%" height="30" align="left" style="font-size:14px; font-weight:bold; color:#124164;">部门列表</td>
		  <td width="29%" align="left" style="font-size:12px;color:#124164;"><a href="javascript: a.openAll();">展开</a> | <a href="javascript: a.closeAll();">收缩</a></td>
        </tr>
      </table>

	  <div style="float:left; width:230px; background-color:#FFFFFF; border:1px solid #999999; height:375px;overflow:hidden;overflow-y:scroll;">
	  <table width="220" border="0" cellspacing="0" cellpadding="0" >
        <tr>
          <td align="left" style="padding-left:6px; padding-top:6px;"><div class="dtree">
	<script type="text/javascript">
		<!--
		a = new dTree('a');
		a.add(0,-1,'部门列表','#');	
		   <?php
	        $query = $db->query("SELECT * FROM ".DB_TABLEPRE."department where father='0' ORDER BY id Asc");
			while ($row = $db->fetch_array($query)) {
			$rsfnow = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."department where father='".$row[id]."' ORDER BY id desc limit 0,1");

			?>
		   a.add(<?=$row[id]?>,0,'<?=$row[name]?>','admin.php?ac=index&fileurl=department&documentid=<?=$row[id]?>');
		
		   
		   <?php 
		   //调用下级文件夹
		   if($rsfnow[id]!=''){
	       	get_document_list($row['id'],0,0);
	       }

		   ?>
		   
		   
		   
		
<?php }?>
			
		
		a.add(999999999,0,'查看所有','#','','','themes01/default/images/trash.gif');
		document.write(a);


		//-->
	</script>
</div></td>
        </tr>
      </table>  
</div>
</td>
    <td valign="top"><div id="MainBody">
<script Language="JavaScript"> 
function CheckForm()
{
   if(document.save.name.value=="")
   { alert("部门名称不能为空！");
     document.save.name.focus();
     return (false);
   }
   if(document.save.persno.value=="")
   { alert("部门负责人不能为空！");
     document.save.persno.focus();
     return (false);
   }
   
   return true;
}
function sendForm()
{
   if(CheckForm())
      document.save.submit();
}
</script>
<form name="save" method="post" action="admin.php?ac=index&fileurl=department">
<?php 
if ($id!=''){
?>
  <input type="hidden" name="savetype" value="edit" />
  <input type="hidden" name="id" value="<?=$rs['id']?>" />
<?php }else{?>
<input type="hidden" name="savetype" value="add" />
<?php }?>
<div id="CodeWrap">
<div id="TabSwitch">
<ul>

<li class="active"><a href="admin.php?ac=index&fileurl=department">部门管理</a></li>

<li>
<img src="themes01/default/images/addicon.gif" width="10" height="10" />&nbsp;<a href="admin.php?ac=index&fileurl=department">新增部门</a></li>
</ul>

 
</div>
<div id="CodeShowBlockWrap">
<div id="QueryBar">
<div id="FilterWrap">
<label for="FilterStatus">
</label>
</div>
</div>

<div id="CodeShowBlock">
<table class="TableBlock no-top-border" width="99%">
    <tr>
      <td nowrap class="TableData" width="15%"> 部门名称：</td>
      <td class="TableData">
        <input type="text" name="name" class="BigInput" size="40" value="<?=$rs[name]?>"/></td>
    </tr>
	<tr>
      <td nowrap class="TableData" width="15%"> 部门负责人：</td>
      <td class="TableData">
        
	<?php
	  get_oa_member_public(2,"persno",$rs[persno],"+选择负责人",50,4)
	  ?>
			</td>
    </tr>
    <tr>
      <td nowrap class="TableData"> 上级部门：</td>
      <td class="TableData"><select class="SelectStyle" name="father">
										<option value="0" >顶级菜单</option>
										<?php GET_document_PUBLIC_LIST(0,$rs[father])?>
										</select>
      </td>
    </tr>
	
</table>
 
</div>
<div id="PageControl">
<div class="page-control">
<div class="border-in">
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30%" align="center">&nbsp;&nbsp;
<!-- <input type="submit" name="do" value="保 存" class="BigButton"/>  -->
 <input type="submit" name="do" value="保 存" class="BigButton" onclick="sendForm();"> </td>
    <td width="70%" align="left"><input type="submit" class="BigButton" name="do" id="button" value="删 除"/></td>
  </tr>
</table>
  

</div>
</div>
</div>
</div>
</div>
 </form>
</div></td>
  </tr>
</table>


</div>
</div>
 
<script language="javascript" src="javascripts01/tangram-1.3.1.js" type="text/javascript"></script>
<script language="javascript" src="javascripts01/elf.js" type="text/javascript"></script>
<script language="javascript" src="javascripts01/union.js" type="text/javascript"></script>
<script language="javascript" src="javascripts01/codeMgr.js" type="text/javascript"></script>
 
</body>
</html>
